//
//  main.swift
//  SwiftMacros
//
//  Created by edy on 2025/10/23.
//

import Foundation
import MyFirstMacro

print("Hello, World!")

//print(#function)

//@OptionSet<Int>
//struct SundaeToppings {
//    private enum Options: Int {
//        case nusts
//        case cherry
//        case fudge
//    }
//}

//public enum StringifyMacro: ExpressionMacro {
//    
//    public static func expasion(of node: some FreestandingMacroExpansionSyntax, in context: some MacroExpansionContext) -> ExprSyntax {
//        guard let argument = node.argumentList.first?.expression else {
//            fatalError("comiler error: the macro does not have any arguments")
//        }
//        
//        return "(\(argument), \(literal: argumnet.description)"
//    }
//    
//}

//@freestanding(expression)
//public macro stringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "MacrosImplementation", type: "StringifyMacro")

let ret = #stringify(10 + 5)
print("\(ret.0), \(ret.1)")

@AddId
class TestClass {
    #defineKeysMacro("bac", "qwe")
}

let test = TestClass()
print(test.id)

struct SundaeToppings {
    private enum Options: Int {
        case nuts
        case cherry
        case fudge
    }
}


@Description
class TTModel: CustomStringConvertible {
    
    var a = 100
    
}

class BaseModel: Codable {
    
    var name: String = ""
    
    @HelloBody
    init() {
        
    }
    
}

@CodableSubclass
class StudentModel: BaseModel {
    var age: Int = 0
    
    override init() {
        super.init()
    }
    
}

let stu = StudentModel()

stu.name = "long"

print(stu.name)


let tt = TTModel()
print(tt)
